package com.shenmazong.user.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 系统用户
 * @TableName tb_sys_user
 */
@TableName(value ="tb_sys_user")
@Data
@ApiModel(value="管理员信息", description="用于管理员增加修改")
@Document(indexName = "tb_sys_user")
public class TbSysUser implements Serializable {
    /**
     * 用户ID
     */
    @TableId(type = IdType.AUTO)
    @Id
    private Integer userId;

    /**
     * 用户名
     */
    @ApiModelProperty(value="登录账号")
    @Field(type = FieldType.Keyword)
    private String userName;

    /**
     * 用户密码
     */
    @ApiModelProperty(value="登录密码")
    @Field(type = FieldType.Keyword)
    private String userPass;


    /**
     * 用户技能
     */
    @ApiModelProperty(value="用户技能")
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String userSkills;

    /**
     * 手机号
     */
    @ApiModelProperty(value="手机号")
    @Field(type = FieldType.Keyword)
    private String userMobile;

    /**
     * 性别，0未知1男2女
     */
    @ApiModelProperty(value="性别")
    @Field(type = FieldType.Integer)
    private Integer userSex;

    /**
     * 用户头像
     */
    @ApiModelProperty(value="用户头像")
    @Field(type = FieldType.Keyword)
    private String userAvatar;

    /**
     * 用户所在城市ID
     */
    @ApiModelProperty(value="城市")
    @Field(type = FieldType.Integer)
    private Integer userCity;

    /**
     * 删除状态0：未删除，1：已删除
     */
    @ApiModelProperty(hidden = true)
    @Field(type = FieldType.Integer)
    private Integer deleted;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(hidden = true)
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(hidden = true)
    @Field(type = FieldType.Date, format = DateFormat.custom, pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}